package com.avocado.actor.impl;

import com.avocado.actor.AbstractActor;
import com.avocado.actor.Actor;
import com.avocado.message.Message;
import com.avocado.stats.ActorStats;

/**
 * @author avocado
 * @date 2023/5/28 22:20
 */
public class DefaultActor extends AbstractActor {

    public void receive(Message message) {
        ActorStats actorStats = getActorStats();
        actorStats.incrReceiveMsgCount();

        Actor sender = message.getSender();
        Object data = message.getData();
        // 协议号 分发即可
        System.out.println(data);
    }

}
